package org.budo.canal.logposition.mixed;

import com.alibaba.otter.canal.parse.index.CanalLogPositionManager;
import com.alibaba.otter.canal.protocol.position.LogPosition;

import lombok.Getter;
import lombok.Setter;

/**
 * @author lmw
 */
@Getter
@Setter
public class PeriodMixedLogPositionManager extends AbstractPeriodMixedLogPositionManager {
    private CanalLogPositionManager canalLogPositionManager;

    @Override
    protected void persistLogPosition_0(String destination, LogPosition logPosition) {
        this.getCanalLogPositionManager().persistLogPosition(destination, logPosition);
    }

    @Override
    protected LogPosition getLatestIndexBy_0(String destination) {
        return this.getCanalLogPositionManager().getLatestIndexBy(destination);
    }
}